feat: Add shell completion support for Bash and Zsh - #1
Conversation
- Add ticket-completion.bash for Bash shell - Add ticket-completion.zsh for Zsh shell - Support both 'ticket' and 'tk' commands - Complete commands, ticket IDs, statuses, types, priorities - Support subcommands (dep tree, --full, etc.) - Handle multi-argument commands (link, dep, etc.)
- Add comprehensive PR description - Add GitHub PR template - Document all features and testing scenarios
Port upstream PR wedow#1 completion scripts into completions/ directory. Updated for current command set: super, dep cycle, list alias, --id, --dir, --tags, --summary, -a/-T filter flags.
Resolves the README conflict by keeping upstream's README intact and adding a Shell completion section instead of replacing the file. Drops files that clobbered maintainer content or were not part of the feature (PR_DESCRIPTION.md, .github/PULL_REQUEST_TEMPLATE.md, diagnose-completion.sh, fix-completion.sh). Completion scripts updated for the current command set: list alias, super, dep cycle, --tags, and the -a/-T filters on ls/ready/blocked/closed. Ticket IDs now resolve the same way ticket does (TICKETS_DIR, then walk parents) instead of only looking at ./.tickets. Bash script no longer hard-requires bash-completion's _init_completion and guards compopt, so it works on the bash 3.2 shipped with macOS. install-completion.sh rewritten: English, non-interactive, user-scope only, no sudo, no reference to the non-existent AUTOCOMPLETE.md. Claude-Session: https://claude.ai/code/session_01WiLZnqcpQ8Y4rGqorcGiVC
|
Rebased on What was wrong: the branch replaced your entire Now: the diff is purely additive — 4 files, no deletions, nothing of yours touched. The README change is a single Completion scripts brought up to date with current
Verified locally: CI here is sitting at Happy to split the script updates into a separate commit or drop the installer entirely if you would rather not ship one. |
parse_reported_cycles() returns ReportedCycle objects, not member-id sets, and parity divergence wedow#1 is pinned by a three-way overlap now. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add Shell Completion Support (Bash & Zsh)
🎯 Overview
This PR adds comprehensive shell completion support for the
ticketCLI tool, supporting both Bash and Zsh shells. The completion works with both theticketcommand and thetkalias.📦 What's New
Completion Scripts
ticket-completion.bash- Full Bash completion supportticket-completion.zsh- Native Zsh completion with descriptionsInstallation Tools
install-completion.sh- Smart installer that detects shell and OSdiagnose-completion.sh- Diagnostic tool for troubleshootingfix-completion.sh- Automatic fix for common configuration issuesDocumentation
README.md- Updated with installation and usage instructions✨ Features
Complete Coverage
All commands and options are supported:
Smart Completion
.tickets/*.mdtk show abc<TAB>completes IDs starting with "abc"linkthat accept multiple IDsCross-Platform
🚀 Installation
Quick Start
Manual Installation
Bash:
Zsh:
cp ticket-completion.zsh $(brew --prefix)/share/zsh/site-functions/_ticket🧪 Testing
Test Scenarios Covered
dep tree)--type,--parent)link)ticketandtkaliasesTested On
🔧 Troubleshooting
If completion doesn't work after installation:
Common issues handled:
fpathconfigurationcompinitin.zshrc📝 Implementation Details
Bash Completion
complete -Ffor function-based completioncompgenfor efficient word matching_init_completiondependency for portabilityZsh Completion
#compdefdirective_argumentsfor structured completionDesign Decisions
.tickets/doesn't exist, still completes commands🔄 Backward Compatibility
📚 Documentation
Updated
README.mdwith:🎓 Usage Examples
Basic Workflow
Advanced Features
🙏 Credits
Implemented following shell completion best practices:
📋 Checklist
ticketandtk🔗 Related
This PR addresses the need for improved developer experience when using the
ticketCLI tool daily.Ready for review! 🚀